package com.winderinfo.yikaotianxia.ui.xiangqin;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

public class DataPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> list;
    private List<String> mTableList;
    private int authorid;
    private String details;

    public DataPagerAdapter(FragmentManager fm, List<Fragment> list, List<String> mTableList, int authorid, String details) {
        super(fm);
        this.list = list;
        this.mTableList = mTableList;
        this.authorid = authorid;
        this.details = details;
    }


    @Override
    public Fragment getItem(int i) {
        Bundle bundle = new Bundle();
        //师资介绍Id
        bundle.putInt("authorid", authorid);
        //详情H5
        bundle.putString("details", details);
        list.get(i).setArguments(bundle);
        return list.get(i);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mTableList.get(position);
    }
}
